home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1989 / Dec 89 / 0133-Notification manager-Nov89 < prev    next >
Encoding:
Text File  |  1991-03-06  |  1.4 KB  |  56 lines  |  [TEXT/GEOL]

  1. Item forwarded  by  A33          to A34
  2.  
  3. Item    2304361                         28-Nov-89        17:44
  4.  
  5. From:   D2652                           Strategic Planning Sys, D Bell,PRT
  6.  
  7. To:     MACAPP.TECH$                    MacApp Technical
  8.  
  9. cc:     MACDTS                          Macintosh Developer Tech. Supt.
  10.  
  11. Sub:    Notification manager probs
  12.  
  13.  
  14. Dear MacAppers,
  15.  
  16.     Hello once again.  We've been trying to use the Notification manager in our
  17. MacApp application, but with little success.  here is the code we have writen,
  18. which is a global procedure called from within our objects:
  19.  
  20. PROCEDURE PostAlarm(aString: Str255);
  21. VAR
  22.    err :   OSErr;
  23.    message :   Str255;
  24.    amessagePtr :   StringPtr;
  25.    aNotePtr:   QElemPtr;
  26.    aNote   :   NMRec;
  27.    minusOne:   LONGINT;
  28.  
  29. BEGIN
  30.    { notification manager stuff }
  31.    minusOne := -1;
  32.  
  33.    WITH aNote DO BEGIN
  34.    qType := 8;
  35.    nmMark := 0;
  36.    nmSIcon := NIL;
  37.    nmSound := NIL;
  38.    nmStr := @aString;
  39.    nmResp := @minusOne;
  40.    nmRefCon := 0;
  41.    END;
  42.    aNotePtr := @aNote;
  43.  
  44.    err := NMInstall(@aNote);
  45.    {$IFC qDebug} writeln('adding note, error = ', err); {$ENDC}
  46. END;
  47.  
  48.  
  49. Once the object calls this procedure, the 'note' is added to the queue with an
  50. error = 0.  After a slight delay, one of two ugly things happens: either a
  51. blank dialog appears, and the computer bombs into MacsBug, or the computer
  52. simply bombs into MacsBug.  Any Clues?  Thanx.
  53.  
  54.                                         DannyC
  55.  
  56.